<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/2/7
  Time: 19:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>pageContext用法</title>
</head>
<body>
<%--在域对象中传递数据--%>
<%
    pageContext.setAttribute("message","Page域的对象");
    pageContext.setAttribute("message","Requeset域对象",PageContext.REQUEST_SCOPE);
    pageContext.setAttribute("message","Session域对象",PageContext.SESSION_SCOPE);
%>
<%=request.getAttribute("message")%>
<%=session.getAttribute("message")%>

<%--转发--%>
<%
//request.getRequestDispatcher("/demo/03.pagecontext2.jsp").forward(request,response);
    response.sendRedirect(request.getContextPath()+"/demo/03.pagecontext2.jsp");
%>
</body>
</html>
